package com.google.android.gms.ads.internal;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.location.Location;
import android.os.Bundle;
import com.google.android.gms.internal.zzacf;
import com.google.android.gms.internal.zzacg;
import com.google.android.gms.internal.zzahe;
import com.google.android.gms.internal.zzala;
import com.google.android.gms.internal.zzali;
import com.google.android.gms.internal.zzkk;
import com.google.android.gms.internal.zzko;
import com.google.android.gms.internal.zzms;
import com.google.android.gms.internal.zzno;
import com.google.android.gms.internal.zzov;
import com.google.android.gms.internal.zzpx;
import com.google.android.gms.internal.zzqh;
import java.util.List;
import java.util.concurrent.Callable;
import org.json.JSONArray;
import org.json.JSONObject;

final class zzbd implements Callable<zzpx> {
    private /* synthetic */ zzahe zzant;
    private /* synthetic */ zzbb zzaro;
    private /* synthetic */ int zzarp;
    private /* synthetic */ JSONArray zzarq;
    private /* synthetic */ int zzarr;

    zzbd(zzbb zzbb, int i, JSONArray jSONArray, int i2, zzahe zzahe) {
        this.zzaro = zzbb;
        this.zzarp = i;
        this.zzarq = jSONArray;
        this.zzarr = i2;
        this.zzant = zzahe;
    }

    public final /* synthetic */ Object call() throws Exception {
        if (this.zzarp >= this.zzarq.length()) {
            return null;
        }
        JSONArray jSONArray = new JSONArray();
        jSONArray.put(this.zzarq.get(this.zzarp));
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("ads", jSONArray);
        zzbb zzbb = new zzbb(this.zzaro.zzanm.zzaiq, this.zzaro.zzanp, this.zzaro.zzanm.zzaud, this.zzaro.zzanm.zzatx, this.zzaro.zzanu, this.zzaro.zzanm.zzatz, true);
        zzbb.zza(this.zzaro.zzanm, zzbb.zzanm);
        zzbb.zzdr();
        zzbb.zza(this.zzaro.zzani);
        zzov zzov = zzbb.zzanh;
        int i = this.zzarp;
        zzov.zzf("num_ads_requested", String.valueOf(this.zzarr));
        zzov.zzf("ad_index", String.valueOf(i));
        zzacf zzacf = this.zzant.zzcvm;
        String jSONObject2 = jSONObject.toString();
        Bundle bundle = zzacf.zzcrv.extras != null ? new Bundle(zzacf.zzcrv.extras) : new Bundle();
        bundle.putString("_ad", jSONObject2);
        int i2 = zzacf.zzcrv.versionCode;
        long j = zzacf.zzcrv.zzbgv;
        int i3 = zzacf.zzcrv.zzbgw;
        List<String> list = zzacf.zzcrv.zzbgx;
        boolean z = zzacf.zzcrv.zzbgy;
        int i4 = zzacf.zzcrv.zzbgz;
        boolean z2 = zzacf.zzcrv.zzbha;
        String str = zzacf.zzcrv.zzbhb;
        zzno zzno = zzacf.zzcrv.zzbhc;
        Location location = zzacf.zzcrv.zzbhd;
        String str2 = zzacf.zzcrv.zzbhe;
        zzno zzno2 = zzno;
        String str3 = str2;
        zzkk zzkk = new zzkk(i2, j, bundle, i3, list, z, i4, z2, str, zzno2, location, str3, zzacf.zzcrv.zzbhf, zzacf.zzcrv.zzbhg, zzacf.zzcrv.zzbhh, zzacf.zzcrv.zzbhi, zzacf.zzcrv.zzbhj, zzacf.zzcrv.zzbhk);
        Bundle bundle2 = zzacf.zzcru;
        zzko zzko = zzacf.zzaud;
        String str4 = zzacf.zzatx;
        ApplicationInfo applicationInfo = zzacf.applicationInfo;
        PackageInfo packageInfo = zzacf.zzcrw;
        String str5 = zzacf.zzcry;
        String str6 = zzacf.zzcrz;
        zzala zzala = zzacf.zzatz;
        Bundle bundle3 = zzacf.zzcsa;
        List<String> list2 = zzacf.zzauy;
        List<String> list3 = zzacf.zzcsk;
        Bundle bundle4 = zzacf.zzcsc;
        boolean z3 = zzacf.zzcsd;
        int i5 = zzacf.zzcse;
        int i6 = zzacf.zzcsf;
        float f = zzacf.zzaxz;
        String str7 = zzacf.zzcsg;
        Bundle bundle5 = bundle3;
        List<String> list4 = list2;
        long j2 = zzacf.zzcsh;
        String str8 = zzacf.zzcsi;
        List<String> list5 = zzacf.zzcsj;
        String str9 = zzacf.zzatw;
        zzqh zzqh = zzacf.zzauq;
        String str10 = zzacf.zzcsm;
        float f2 = zzacf.zzcsn;
        boolean z4 = zzacf.zzcst;
        int i7 = zzacf.zzcso;
        int i8 = zzacf.zzcsp;
        boolean z5 = zzacf.zzcsq;
        boolean z6 = zzacf.zzcsr;
        Bundle bundle6 = bundle4;
        zzals zzh = zzali.zzh(zzacf.zzcss);
        String str11 = zzacf.zzcsu;
        boolean z7 = z6;
        boolean z8 = zzacf.zzcia;
        int i9 = zzacf.zzcsv;
        Bundle bundle7 = zzacf.zzcsw;
        String str12 = zzacf.zzcsx;
        zzms zzms = zzacf.zzaus;
        boolean z9 = zzacf.zzcsy;
        Bundle bundle8 = zzacf.zzcsz;
        List<String> list6 = list3;
        zzkk zzkk2 = zzkk;
        PackageInfo packageInfo2 = packageInfo;
        String str13 = str5;
        String str14 = str6;
        zzala zzala2 = zzala;
        Bundle bundle9 = bundle5;
        List<String> list7 = list4;
        boolean z10 = z3;
        int i10 = i5;
        int i11 = i6;
        float f3 = f;
        String str15 = str7;
        long j3 = j2;
        String str16 = str8;
        List<String> list8 = list5;
        String str17 = str9;
        zzqh zzqh2 = zzqh;
        String str18 = str10;
        float f4 = f2;
        boolean z11 = z4;
        int i12 = i7;
        int i13 = i8;
        boolean z12 = z5;
        boolean z13 = z7;
        zzbb zzbb2 = zzbb;
        zzbb2.zza(new zzacg(bundle2, zzkk2, zzko, str4, applicationInfo, packageInfo2, str13, str14, zzala2, bundle9, list7, list6, bundle6, z10, i10, i11, f3, str15, j3, str16, list8, str17, zzqh2, str18, f4, z11, i12, i13, z12, z13, zzh, str11, z8, i9, bundle7, str12, zzms, z9, bundle8, zzacf.zzctd, zzali.zzh(zzacf.zzcrx), zzacf.zzauu, zzacf.zzcte, zzacf.zzctf, 1, zzacf.zzcth, zzacf.zzcti, zzacf.zzctj), zzbb2.zzanh);
        return zzbb2.zzdt().get();
    }
}
